﻿using ETask.Api.Data;
using ETask.Api.Dtos;
using ETask.Api.Mappers;
using ETask.Api.Models;
using ETask.Api.Repositories;

namespace ETask.Api.Services
{
    public class ProjectService : GenericService<Project, ProjectDto, CreateProjectDto, UpdateProjectDto>, IProjectService
    {
        private readonly IProjectRepository _repository;

        private readonly IUserRepository _userRepository;

        public ProjectService(IProjectRepository repository, IUserRepository userRepository, GenericMapper<Project, ProjectDto, CreateProjectDto, UpdateProjectDto> mapper) : base(repository, mapper)
        {
            _userRepository = userRepository;
            _repository = repository;
        }

        #region 项目管理
        public async Task<ApiResponse> GetList(ProjectListParams listParams)
        {
            var result = await _repository.GetListAsync(listParams);
            return ApiResponse.Ok(result);
        }
        #endregion

    }
}
